﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KMS.Core.domain.model.post;
using KMS.Core.domain.model.user;
using KMS.Core.domain.model.project;

namespace KMS.Web.Tests.Factory
{
    public class PostFactory
    {
        private User _author;
        private string _title;
        private string _content;
        private Project _project;
        private DateTime _dateTime;

        public Resource CreateResource(User author, string title, string content, Project initialProject, DateTime dateTime)
        {
            return new Resource(author, title, content, initialProject, dateTime);
        }

        public Resource CreateResource()
        {
            return new Resource(_author, _title, _content, _project, _dateTime);
        }

        public Resource CreateResourceWithContent(string content)
        {
            return new Resource(_author, _title, content, _project, _dateTime);
        }

        public Resource CreateResourceWithTitle(string title)
        {
            return new Resource(_author, title, _content, _project, _dateTime);
        }

        public PostFactory()
        {
            _author = new UserFactory().Create();
            _title = "test title";
            _content = "test content";
            _project = new Project("test project");
            _dateTime = DateTime.Now.AddDays(-10);
        }
    }
}
